package com.moleq.models;

import com.moleq.db.DatabaseSchema;

import android.R.integer;

public class DvrSetting {
//	CREATE TABLE t_dvr_setting
//	(ds_id INTEGER NOT NULL,
//	ds_onoff varchar(1) DEFAULT '0' NOT NULL,
//	ds_dvr_ip varchar(15) NULL,
//	ds_port INTEGER NULL,
//	PRIMARY KEY (ds_id));
	
	public DvrSetting(){}
	public DvrSetting(int ds_id,String ds_onoff,String ds_dvr_ip,int ds_port){
		this.ds_id = ds_id;
		this.ds_onoff = ds_onoff;
		this.ds_dvr_ip = ds_dvr_ip;
		this.ds_port = ds_port;
	}
	private int ds_id;
	private String ds_onoff;
	private String ds_dvr_ip;
	private int ds_port;
	
	public int getDs_id() {
		return ds_id;
	}
	public void setDs_id(int ds_id) {
		this.ds_id = ds_id;
	}
	public String getDs_onoff() {
		return ds_onoff;
	}
	public void setDs_onoff(String ds_onoff) {
		this.ds_onoff = ds_onoff;
	}
	public String getDs_dvr_ip() {
		return ds_dvr_ip;
	}

	public void setDs_dvr_ip(String ds_dvr_ip) {
		this.ds_dvr_ip = ds_dvr_ip;
	}
	public int getDs_port() {
		return ds_port;
	}
	public void setDs_port(int ds_port) {
		this.ds_port = ds_port;
	}
	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.DvrSetting.SCHEMA_NAME
				+ "|(" + "1" + "," + CheckNull(ds_onoff) + "," + CheckNull(ds_dvr_ip)+ "," + ds_port + ")";
		return Result;
	}
	
	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}
}
